import MapFeature from "./MapFeature";
import BaseMarker from "./baseMarker";
import Base from './base';
import * as ftypes from '../featureTypes'
import Partition from "./partition";
import Field from "./field";

var lastEditFeature =  new MapFeature();

function newBaseMarker(feature){
    lastEditFeature.cancel(); 
    lastEditFeature = new BaseMarker(feature);
    return lastEditFeature;
}

function newBase(f){
    lastEditFeature.cancel();
    lastEditFeature = new Base(f);
    return lastEditFeature;
}


function newPartition(f){
    lastEditFeature.cancel();
    lastEditFeature = new Partition(f);
    return lastEditFeature;
}


function newField(f){
    lastEditFeature.cancel();
    lastEditFeature = new Field(f);
    return lastEditFeature;
} 


export {newBaseMarker,newBase,newPartition,newField};